/*

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

*/
module derelict.freeimage.functions;

private
{
    import core.stdc.config;
    import core.stdc.stddef;
    import derelict.freeimage.types;
    import derelict.util.system;
}

extern(System)
{
    alias nothrow void function(BOOL load_local_plugins_only = FALSE) da_FreeImage_Initialise;
    alias nothrow void function() da_FreeImage_DeInitialise;
    alias nothrow const(char)* function() da_FreeImage_GetVersion;
    alias nothrow const(char)* function() da_FreeImage_GetCopyrightMessage;

    // Message output functions -------------------------------------------------

    alias nothrow void function(FreeImage_OutputMessageFunctionStdCall omf) da_FreeImage_SetOutputMessageStdCall;
    alias nothrow void function(FreeImage_OutputMessageFunction omf) da_FreeImage_SetOutputMessage;

    // interacts badly with stdcall mangling
    alias nothrow void function(int fif, const(char)* fmt, ...) da_FreeImage_OutputMessageProc;

    // Allocate / Clone / Unload routines ---------------------------------------

    alias nothrow FIBITMAP* function(int width, int height, int bpp, uint red_mask = 0, uint green_mask = 0, uint blue_mask = 0) da_FreeImage_Allocate;
    alias nothrow FIBITMAP* function(FREE_IMAGE_TYPE type, int width, int height, int bpp = 8, uint red_mask = 0, uint green_mask = 0, uint blue_mask = 0) da_FreeImage_AllocateT;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_Clone;
    alias nothrow void function(FIBITMAP* dib) da_FreeImage_Unload;

    // Header loading routines
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_HasPixels;

    // Load / Save routines -----------------------------------------------------

    alias nothrow FIBITMAP* function(FREE_IMAGE_FORMAT fif, const(char)* filename, int flags = 0) da_FreeImage_Load;
    alias nothrow FIBITMAP* function(FREE_IMAGE_FORMAT fif, const(wchar_t)* filename, int flags = 0) da_FreeImage_LoadU;
    alias nothrow FIBITMAP* function(FREE_IMAGE_FORMAT fif, FreeImageIO* io, fi_handle handle, int flags = 0) da_FreeImage_LoadFromHandle;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const(char)* filename, int flags = 0) da_FreeImage_Save;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const(wchar_t)* filename, int flags = 0) da_FreeImage_SaveU;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, FreeImageIO* io, fi_handle handle, int flags = 0) da_FreeImage_SaveToHandle;

    // Memory I/O stream routines -----------------------------------------------

    alias nothrow FIMEMORY*  function(BYTE* data = null, DWORD size_in_bytes = 0) da_FreeImage_OpenMemory;
    alias nothrow void function(FIMEMORY* stream) da_FreeImage_CloseMemory;
    alias nothrow FIBITMAP* function(FREE_IMAGE_FORMAT fif, FIMEMORY* stream, int flags = 0) da_FreeImage_LoadFromMemory;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, FIMEMORY* stream, int flags = 0) da_FreeImage_SaveToMemory;
    alias nothrow c_long function(FIMEMORY* stream) da_FreeImage_TellMemory;
    alias nothrow BOOL function(FIMEMORY* stream, c_long offset, int origin) da_FreeImage_SeekMemory;
    alias nothrow BOOL function(FIMEMORY* stream, BYTE**data, DWORD* size_in_bytes) da_FreeImage_AcquireMemory;
    alias nothrow uint function(void* buffer, uint size, uint count, FIMEMORY* stream) da_FreeImage_ReadMemory;
    alias nothrow uint function(const(void*) buffer, uint size, uint count, FIMEMORY* stream) da_FreeImage_WriteMemory;

    alias nothrow FIMULTIBITMAP*  function(FREE_IMAGE_FORMAT fif, FIMEMORY* stream, int flags = 0) da_FreeImage_LoadMultiBitmapFromMemory;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP* bitmap, FIMEMORY* stream, int flags) da_FreeImage_SaveMultiBitmapToMemory;

    // Plugin Interface ---------------------------------------------------------

    alias nothrow FREE_IMAGE_FORMAT function(FI_InitProc proc_address, const(char)* format = null, const(char)* description = null, const(char)* extension = null, const(char)* regexpr = null) da_FreeImage_RegisterLocalPlugin;

    static if (Derelict_OS_Windows)
        alias nothrow FREE_IMAGE_FORMAT function(const(char)* path, const(char)* format = null, const(char)* description = null, const(char)* extension = null, const(char)* regexpr = null) da_FreeImage_RegisterExternalPlugin;

    alias nothrow int function() da_FreeImage_GetFIFCount;
    alias nothrow int function(FREE_IMAGE_FORMAT fif, BOOL enable) da_FreeImage_SetPluginEnabled;
    alias nothrow int function(FREE_IMAGE_FORMAT fif) da_FreeImage_IsPluginEnabled;
    alias nothrow FREE_IMAGE_FORMAT function (const(char)* format) da_FreeImage_GetFIFFromFormat;
    alias nothrow FREE_IMAGE_FORMAT function (const(char)* mime) da_FreeImage_GetFIFFromMime;
    alias nothrow const(char)* function (FREE_IMAGE_FORMAT fif) da_FreeImage_GetFormatFromFIF;
    alias nothrow const(char)* function (FREE_IMAGE_FORMAT fif) da_FreeImage_GetFIFExtensionList;
    alias nothrow const(char)* function (FREE_IMAGE_FORMAT fif) da_FreeImage_GetFIFDescription;
    alias nothrow const(char)* function (FREE_IMAGE_FORMAT fif) da_FreeImage_GetFIFRegExpr;
    alias nothrow const(char)* function (FREE_IMAGE_FORMAT fif) da_FreeImage_GetFIFMimeType;
    alias nothrow FREE_IMAGE_FORMAT function(const(char)* filename) da_FreeImage_GetFIFFromFilename;
    alias nothrow FREE_IMAGE_FORMAT function(const(wchar_t)* filename) da_FreeImage_GetFIFFromFilenameU;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif) da_FreeImage_FIFSupportsReading;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif) da_FreeImage_FIFSupportsWriting;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, int bpp) da_FreeImage_FIFSupportsExportBPP;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type) da_FreeImage_FIFSupportsExportType;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif) da_FreeImage_FIFSupportsICCProfiles;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif) da_FreeImage_FIFSupportsNoPixels;

    // Multipaging interface ----------------------------------------------------

    alias nothrow FIMULTIBITMAP* function(FREE_IMAGE_FORMAT fif, const(char)* filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory = FALSE, int flags = 0) da_FreeImage_OpenMultiBitmap;
    alias nothrow FIMULTIBITMAP* function(FREE_IMAGE_FORMAT fif, FreeImageIO* io, fi_handle handle, int flags = 0) da_FreeImage_OpenMultiBitmapFromHandle;
    alias nothrow BOOL function(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP* bitmap, FreeImageIO* io, fi_handle handle, int flags = 0) da_FreeImage_SaveMultiBitmapToHandle;
    alias nothrow BOOL function(FIMULTIBITMAP* bitmap, int flags = 0) da_FreeImage_CloseMultiBitmap;
    alias nothrow int function(FIMULTIBITMAP* bitmap) da_FreeImage_GetPageCount;
    alias nothrow void function(FIMULTIBITMAP* bitmap, FIBITMAP*data) da_FreeImage_AppendPage;
    alias nothrow void function(FIMULTIBITMAP* bitmap, int page, FIBITMAP*data) da_FreeImage_InsertPage;
    alias nothrow void function(FIMULTIBITMAP* bitmap, int page) da_FreeImage_DeletePage;
    alias nothrow FIBITMAP* function(FIMULTIBITMAP* bitmap, int page) da_FreeImage_LockPage;
    alias nothrow void function(FIMULTIBITMAP* bitmap, FIBITMAP*data, BOOL changed) da_FreeImage_UnlockPage;
    alias nothrow BOOL function(FIMULTIBITMAP* bitmap, int target, int source) da_FreeImage_MovePage;
    alias nothrow BOOL function(FIMULTIBITMAP* bitmap, int* pages, int* count) da_FreeImage_GetLockedPageNumbers;

    // Filetype request routines ------------------------------------------------

    alias nothrow FREE_IMAGE_FORMAT function(const(char)* filename, int size = 0) da_FreeImage_GetFileType;
    alias nothrow FREE_IMAGE_FORMAT function(const(wchar_t)* filename, int size = 0) da_FreeImage_GetFileTypeU;
    alias nothrow FREE_IMAGE_FORMAT function(FreeImageIO* io, fi_handle handle, int size = 0) da_FreeImage_GetFileTypeFromHandle;
    alias nothrow FREE_IMAGE_FORMAT function(FIMEMORY* stream, int size = 0) da_FreeImage_GetFileTypeFromMemory;

    // Image type request routine -----------------------------------------------

    alias nothrow FREE_IMAGE_TYPE function(FIBITMAP* dib) da_FreeImage_GetImageType;

    // FreeImage helper routines ------------------------------------------------

    alias nothrow BOOL function() da_FreeImage_IsLittleEndian;
    alias nothrow BOOL function(const(char)* szColor, BYTE* nRed, BYTE* nGreen, BYTE* nBlue) da_FreeImage_LookupX11Color;
    alias nothrow BOOL function(const(char)* szColor, BYTE* nRed, BYTE* nGreen, BYTE* nBlue) da_FreeImage_LookupSVGColor;

    // Pixel access routines ----------------------------------------------------

    alias nothrow BYTE*  function(FIBITMAP* dib) da_FreeImage_GetBits;
    alias nothrow BYTE*  function(FIBITMAP* dib, int scanline) da_FreeImage_GetScanLine;

    alias nothrow BOOL function(FIBITMAP* dib, uint x, uint y, BYTE* value) da_FreeImage_GetPixelIndex;
    alias nothrow BOOL function(FIBITMAP* dib, uint x, uint y, RGBQUAD* value) da_FreeImage_GetPixelColor;
    alias nothrow BOOL function(FIBITMAP* dib, uint x, uint y, BYTE* value) da_FreeImage_SetPixelIndex;
    alias nothrow BOOL function(FIBITMAP* dib, uint x, uint y, RGBQUAD* value) da_FreeImage_SetPixelColor;

    // DIB info routines --------------------------------------------------------

    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetColorsUsed;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetBPP;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetWidth;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetHeight;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetLine;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetPitch;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetDIBSize;
    alias nothrow RGBQUAD* function(FIBITMAP* dib) da_FreeImage_GetPalette;

    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetDotsPerMeterX;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetDotsPerMeterY;
    alias nothrow void function(FIBITMAP* dib, uint res) da_FreeImage_SetDotsPerMeterX;
    alias nothrow void function(FIBITMAP* dib, uint res) da_FreeImage_SetDotsPerMeterY;

    alias nothrow BITMAPINFOHEADER* function(FIBITMAP* dib) da_FreeImage_GetInfoHeader;
    alias nothrow BITMAPINFO* function(FIBITMAP* dib) da_FreeImage_GetInfo;
    alias nothrow FREE_IMAGE_COLOR_TYPE function(FIBITMAP* dib) da_FreeImage_GetColorType;

    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetRedMask;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetGreenMask;
    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetBlueMask;

    alias nothrow uint function(FIBITMAP* dib) da_FreeImage_GetTransparencyCount;
    alias nothrow BYTE*  function(FIBITMAP* dib) da_FreeImage_GetTransparencyTable;
    alias nothrow void function(FIBITMAP* dib, BOOL enabled) da_FreeImage_SetTransparent;
    alias nothrow void function(FIBITMAP* dib, BYTE* table, int count) da_FreeImage_SetTransparencyTable;
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_IsTransparent;
    alias nothrow void function(FIBITMAP* dib, int index) da_FreeImage_SetTransparentIndex;
    alias nothrow int function(FIBITMAP* dib) da_FreeImage_GetTransparentIndex;

    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_HasBackgroundColor;
    alias nothrow BOOL function(FIBITMAP* dib, RGBQUAD* bkcolor) da_FreeImage_GetBackgroundColor;
    alias nothrow BOOL function(FIBITMAP* dib, RGBQUAD* bkcolor) da_FreeImage_SetBackgroundColor;

    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_GetThumbnail;
    alias nothrow BOOL function(FIBITMAP* dib, FIBITMAP*thumbnail) da_FreeImage_SetThumbnail;

    // ICC profile routines -----------------------------------------------------

    alias nothrow FIICCPROFILE* function(FIBITMAP* dib) da_FreeImage_GetICCProfile;
    alias nothrow FIICCPROFILE* function(FIBITMAP* dib, void* data, c_long size) da_FreeImage_CreateICCProfile;
    alias nothrow void function(FIBITMAP* dib) da_FreeImage_DestroyICCProfile;

    // Line conversion routines -------------------------------------------------

    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine1To4;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine8To4;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To4_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To4_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine24To4;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine32To4;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine1To8;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine4To8;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To8_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To8_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine24To8;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine32To8;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine1To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine4To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine8To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16_565_To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine24To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine32To16_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine1To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine4To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine8To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16_555_To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine24To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine32To16_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine1To24;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine4To24;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine8To24;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To24_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To24_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine32To24;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine1To32;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine4To32;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels, RGBQUAD* palette) da_FreeImage_ConvertLine8To32;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To32_555;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine16To32_565;
    alias nothrow void function(BYTE* target, BYTE* source, int width_in_pixels) da_FreeImage_ConvertLine24To32;

    // Smart conversion routines ------------------------------------------------

    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo4Bits;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo8Bits;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertToGreyscale;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo16Bits555;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo16Bits565;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo24Bits;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertTo32Bits;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, FREE_IMAGE_QUANTIZE quantize) da_FreeImage_ColorQuantize;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, FREE_IMAGE_QUANTIZE quantize = FIQ_WUQUANT, int PaletteSize = 256, int ReserveSize = 0, RGBQUAD* ReservePalette = null) da_FreeImage_ColorQuantizeEx;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, BYTE T) da_FreeImage_Threshold;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, FREE_IMAGE_DITHER algorithm) da_FreeImage_Dither;

    alias nothrow FIBITMAP* function(BYTE* bits, int width, int height, int pitch, uint bpp, uint red_mask, uint green_mask, uint blue_mask, BOOL topdown = FALSE) da_FreeImage_ConvertFromRawBits;
    alias nothrow void function(BYTE* bits, FIBITMAP* dib, int pitch, uint bpp, uint red_mask, uint green_mask, uint blue_mask, BOOL topdown = FALSE) da_FreeImage_ConvertToRawBits;

    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertToFloat;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertToRGBF;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertToUINT16;
    alias nothrow FIBITMAP* function(FIBITMAP* dib) da_FreeImage_ConvertToRGB16;

    alias nothrow FIBITMAP* function(FIBITMAP* src, BOOL scale_linear = TRUE) da_FreeImage_ConvertToStandardType;
    alias nothrow FIBITMAP* function(FIBITMAP* src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear = TRUE) da_FreeImage_ConvertToType;

    // tone mapping operators
    alias nothrow FIBITMAP* function(FIBITMAP* dib, FREE_IMAGE_TMO tmo, double first_param = 0, double second_param = 0) da_FreeImage_ToneMapping;
    alias nothrow FIBITMAP* function(FIBITMAP* src, double gamma = 2.2, double exposure = 0) da_FreeImage_TmoDrago03;
    alias nothrow FIBITMAP* function(FIBITMAP* src, double intensity = 0, double contrast = 0) da_FreeImage_TmoReinhard05;
    alias nothrow FIBITMAP* function(FIBITMAP* src, double intensity = 0, double contrast = 0, double adaptation = 1, double color_correction = 0) da_FreeImage_TmoReinhard05Ex;

    alias nothrow FIBITMAP* function(FIBITMAP* src, double color_saturation = 0.5, double attenuation = 0.85) da_FreeImage_TmoFattal02;

    // ZLib interface -----------------------------------------------------------

    alias nothrow DWORD function(BYTE* target, DWORD target_size, BYTE* source, DWORD source_size) da_FreeImage_ZLibCompress;
    alias nothrow DWORD function(BYTE* target, DWORD target_size, BYTE* source, DWORD source_size) da_FreeImage_ZLibUncompress;
    alias nothrow DWORD function(BYTE* target, DWORD target_size, BYTE* source, DWORD source_size) da_FreeImage_ZLibGZip;
    alias nothrow DWORD function(BYTE* target, DWORD target_size, BYTE* source, DWORD source_size) da_FreeImage_ZLibGUnzip;
    alias nothrow DWORD function(DWORD crc, BYTE* source, DWORD source_size) da_FreeImage_ZLibCRC32;

    // --------------------------------------------------------------------------
    // Metadata routines --------------------------------------------------------
    // --------------------------------------------------------------------------

    // tag creation / destruction
    alias nothrow FITAG* function() da_FreeImage_CreateTag;
    alias nothrow void function(FITAG* tag) da_FreeImage_DeleteTag;
    alias nothrow FITAG* function(FITAG* tag) da_FreeImage_CloneTag;

    // tag getters and setters
    alias nothrow const(char)* function(FITAG* tag) da_FreeImage_GetTagKey;
    alias nothrow const(char)* function(FITAG* tag) da_FreeImage_GetTagDescription;
    alias nothrow WORD function(FITAG* tag) da_FreeImage_GetTagID;
    alias nothrow FREE_IMAGE_MDTYPE function(FITAG* tag) da_FreeImage_GetTagType;
    alias nothrow DWORD function(FITAG* tag) da_FreeImage_GetTagCount;
    alias nothrow DWORD function(FITAG* tag) da_FreeImage_GetTagLength;
    alias nothrow const(void)* function(FITAG* tag) da_FreeImage_GetTagValue;

    alias nothrow BOOL function (FITAG* tag, const(char)* key) da_FreeImage_SetTagKey;
    alias nothrow BOOL function (FITAG* tag, const(char)* description) da_FreeImage_SetTagDescription;
    alias nothrow BOOL function (FITAG* tag, WORD id) da_FreeImage_SetTagID;
    alias nothrow BOOL function (FITAG* tag, FREE_IMAGE_MDTYPE type) da_FreeImage_SetTagType;
    alias nothrow BOOL function (FITAG* tag, DWORD count) da_FreeImage_SetTagCount;
    alias nothrow BOOL function (FITAG* tag, DWORD length) da_FreeImage_SetTagLength;
    alias nothrow BOOL function (FITAG* tag, const(void)* value) da_FreeImage_SetTagValue;

    // iterator
    alias nothrow FIMETADATA* function(FREE_IMAGE_MDMODEL model, FIBITMAP* dib, FITAG** tag) da_FreeImage_FindFirstMetadata;
    alias nothrow BOOL function(FIMETADATA* mdhandle, FITAG** tag) da_FreeImage_FindNextMetadata;
    alias nothrow void function(FIMETADATA* mdhandle) da_FreeImage_FindCloseMetadata;

    // metadata setter and getter
    alias nothrow BOOL function(FREE_IMAGE_MDMODEL model, FIBITMAP* dib, const(char)* key, FITAG** tag) da_FreeImage_GetMetadata;
    alias nothrow BOOL function(FREE_IMAGE_MDMODEL model, FIBITMAP* dib, const(char)* key, FITAG* tag) da_FreeImage_SetMetadata;

    // helpers
    alias nothrow uint function(FREE_IMAGE_MDMODEL model, FIBITMAP* dib) da_FreeImage_GetMetadataCount;
    alias nothrow BOOL function(FIBITMAP* dst, FIBITMAP* src) da_FreeImage_CloneMetadata;

    // tag to C string conversion
    alias nothrow const(char)* function(FREE_IMAGE_MDMODEL model, FITAG* tag, char* Make = null) da_FreeImage_TagToString;

    // --------------------------------------------------------------------------
    // Image manipulation toolkit -----------------------------------------------
    // --------------------------------------------------------------------------

    // rotation and flipping
    /// @deprecated see FreeImage_Rotate
    alias nothrow FIBITMAP* function(FIBITMAP* dib, double angle) da_FreeImage_RotateClassic;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, double angle, const(void*) bkcolor = null) da_FreeImage_Rotate;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask) da_FreeImage_RotateEx;
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_FlipHorizontal;
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_FlipVertical;
    alias nothrow BOOL function(const(char)* src_file, const(char)* dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect = FALSE) da_FreeImage_JPEGTransform;
    alias nothrow BOOL function(const(wchar_t)* src_file, const(wchar_t)* dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect = FALSE) da_FreeImage_JPEGTransformU;

    // upsampling / downsampling
    alias nothrow FIBITMAP* function(FIBITMAP* dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter) da_FreeImage_Rescale;
    alias nothrow FIBITMAP* function(FIBITMAP* dib, int max_pixel_size, BOOL convert = TRUE) da_FreeImage_MakeThumbnail;

    // color manipulation routines (point operations)
    alias nothrow BOOL function(FIBITMAP* dib, BYTE* LUT, FREE_IMAGE_COLOR_CHANNEL channel) da_FreeImage_AdjustCurve;
    alias nothrow BOOL function(FIBITMAP* dib, double gamma) da_FreeImage_AdjustGamma;
    alias nothrow BOOL function(FIBITMAP* dib, double percentage) da_FreeImage_AdjustBrightness;
    alias nothrow BOOL function(FIBITMAP* dib, double percentage) da_FreeImage_AdjustContrast;
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_Invert;
    alias nothrow BOOL function(FIBITMAP* dib, DWORD* histo, FREE_IMAGE_COLOR_CHANNEL channel = FICC_BLACK) da_FreeImage_GetHistogram;
    alias nothrow int function(BYTE* LUT, double brightness, double contrast, double gamma, BOOL invert) da_FreeImage_GetAdjustColorsLookupTable;
    alias nothrow BOOL function(FIBITMAP* dib, double brightness, double contrast, double gamma, BOOL invert = FALSE) da_FreeImage_AdjustColors;
    alias nothrow uint function(FIBITMAP* dib, RGBQUAD* srccolors, RGBQUAD* dstcolors, uint count, BOOL ignore_alpha, BOOL swap) da_FreeImage_ApplyColorMapping;
    alias nothrow uint function(FIBITMAP* dib, RGBQUAD* color_a, RGBQUAD* color_b, BOOL ignore_alpha) da_FreeImage_SwapColors;
    alias nothrow uint function(FIBITMAP* dib, BYTE* srcindices,   BYTE* dstindices, uint count, BOOL swap) da_FreeImage_ApplyPaletteIndexMapping;
    alias nothrow uint function(FIBITMAP* dib, BYTE* index_a, BYTE* index_b) da_FreeImage_SwapPaletteIndices;

    // channel processing routines
    alias nothrow FIBITMAP* function(FIBITMAP* dib, FREE_IMAGE_COLOR_CHANNEL channel) da_FreeImage_GetChannel;
    alias nothrow BOOL function(FIBITMAP*dst, FIBITMAP*src, FREE_IMAGE_COLOR_CHANNEL channel) da_FreeImage_SetChannel;
    alias nothrow FIBITMAP* function(FIBITMAP*src, FREE_IMAGE_COLOR_CHANNEL channel) da_FreeImage_GetComplexChannel;
    alias nothrow BOOL function(FIBITMAP*dst, FIBITMAP*src, FREE_IMAGE_COLOR_CHANNEL channel) da_FreeImage_SetComplexChannel;

    // copy / paste / composite routines
    alias nothrow FIBITMAP* function(FIBITMAP* dib, int left, int top, int right, int bottom) da_FreeImage_Copy;
    alias nothrow BOOL function(FIBITMAP*dst, FIBITMAP*src, int left, int top, int alpha) da_FreeImage_Paste;
    alias nothrow FIBITMAP* function(FIBITMAP*fg, BOOL useFileBkg = FALSE, RGBQUAD* appBkColor = null, FIBITMAP*bg = null) da_FreeImage_Composite;
    alias nothrow BOOL function(const(char)* src_file, const(char)* dst_file, int left, int top, int right, int bottom) da_FreeImage_JPEGCrop;
    alias nothrow BOOL function(const(wchar_t)* src_file, const(wchar_t)* dst_file, int left, int top, int right, int bottom) da_FreeImage_JPEGCropU;
    alias nothrow BOOL function(FIBITMAP* dib) da_FreeImage_PreMultiplyWithAlpha;

    // background filling routines
    alias nothrow BOOL function(FIBITMAP* dib, const(void*) color, int options = 0) da_FreeImage_FillBackground;
    alias nothrow FIBITMAP* function(FIBITMAP*src, int left, int top, int right, int bottom, const(void*) color, int options = 0) da_FreeImage_EnlargeCanvas;
    alias nothrow FIBITMAP* function(int width, int height, int bpp, const(RGBQUAD)* color, int options = 0, const(RGBQUAD)* palette = null, uint red_mask = 0, uint green_mask = 0, uint blue_mask = 0) da_FreeImage_AllocateEx;
    alias nothrow FIBITMAP* function(FREE_IMAGE_TYPE type, int width, int height, int bpp, const(void*) color, int options = 0, const(RGBQUAD)* palette = null, uint red_mask = 0, uint green_mask = 0, uint blue_mask = 0) da_FreeImage_AllocateExT;

    // miscellaneous algorithms
    alias nothrow FIBITMAP* function(FIBITMAP*Laplacian, int ncycle = 3) da_FreeImage_MultigridPoissonSolver;
}

__gshared
{
    da_FreeImage_Initialise FreeImage_Initialise;
    da_FreeImage_DeInitialise FreeImage_DeInitialise;
    da_FreeImage_GetVersion FreeImage_GetVersion;
    da_FreeImage_GetCopyrightMessage FreeImage_GetCopyrightMessage;
    da_FreeImage_SetOutputMessageStdCall FreeImage_SetOutputMessageStdCall;
    da_FreeImage_SetOutputMessage FreeImage_SetOutputMessage;

    // interacts badly with stdcall mangling
    da_FreeImage_OutputMessageProc FreeImage_OutputMessageProc;

    da_FreeImage_Allocate FreeImage_Allocate;
    da_FreeImage_AllocateT FreeImage_AllocateT;
    da_FreeImage_Clone FreeImage_Clone;
    da_FreeImage_Unload FreeImage_Unload;
    da_FreeImage_HasPixels FreeImage_HasPixels;
    da_FreeImage_Load FreeImage_Load;
    da_FreeImage_LoadU FreeImage_LoadU;
    da_FreeImage_LoadFromHandle FreeImage_LoadFromHandle;
    da_FreeImage_Save FreeImage_Save;
    da_FreeImage_SaveU FreeImage_SaveU;
    da_FreeImage_SaveToHandle FreeImage_SaveToHandle;
    da_FreeImage_OpenMemory FreeImage_OpenMemory;
    da_FreeImage_CloseMemory FreeImage_CloseMemory;
    da_FreeImage_LoadFromMemory FreeImage_LoadFromMemory;
    da_FreeImage_SaveToMemory FreeImage_SaveToMemory;
    da_FreeImage_TellMemory FreeImage_TellMemory;
    da_FreeImage_SeekMemory FreeImage_SeekMemory;
    da_FreeImage_AcquireMemory FreeImage_AcquireMemory;
    da_FreeImage_ReadMemory FreeImage_ReadMemory;
    da_FreeImage_WriteMemory FreeImage_WriteMemory;
    da_FreeImage_LoadMultiBitmapFromMemory FreeImage_LoadMultiBitmapFromMemory;
    da_FreeImage_SaveMultiBitmapToMemory FreeImage_SaveMultiBitmapToMemory;
    da_FreeImage_RegisterLocalPlugin FreeImage_RegisterLocalPlugin;

    static if (Derelict_OS_Windows)
        da_FreeImage_RegisterExternalPlugin FreeImage_RegisterExternalPlugin;

    da_FreeImage_GetFIFCount FreeImage_GetFIFCount;
    da_FreeImage_SetPluginEnabled FreeImage_SetPluginEnabled;
    da_FreeImage_IsPluginEnabled FreeImage_IsPluginEnabled;
    da_FreeImage_GetFIFFromFormat FreeImage_GetFIFFromFormat;
    da_FreeImage_GetFIFFromMime FreeImage_GetFIFFromMime;
    da_FreeImage_GetFormatFromFIF FreeImage_GetFormatFromFIF;
    da_FreeImage_GetFIFExtensionList FreeImage_GetFIFExtensionList;
    da_FreeImage_GetFIFDescription FreeImage_GetFIFDescription;
    da_FreeImage_GetFIFRegExpr FreeImage_GetFIFRegExpr;
    da_FreeImage_GetFIFMimeType FreeImage_GetFIFMimeType;
    da_FreeImage_GetFIFFromFilename FreeImage_GetFIFFromFilename;
    da_FreeImage_GetFIFFromFilenameU FreeImage_GetFIFFromFilenameU;
    da_FreeImage_FIFSupportsReading FreeImage_FIFSupportsReading;
    da_FreeImage_FIFSupportsWriting FreeImage_FIFSupportsWriting;
    da_FreeImage_FIFSupportsExportBPP FreeImage_FIFSupportsExportBPP;
    da_FreeImage_FIFSupportsExportType FreeImage_FIFSupportsExportType;
    da_FreeImage_FIFSupportsICCProfiles FreeImage_FIFSupportsICCProfiles;
    da_FreeImage_FIFSupportsNoPixels FreeImage_FIFSupportsNoPixels;
    da_FreeImage_OpenMultiBitmap FreeImage_OpenMultiBitmap;
    da_FreeImage_OpenMultiBitmapFromHandle FreeImage_OpenMultiBitmapFromHandle;
    da_FreeImage_SaveMultiBitmapToHandle FreeImage_SaveMultiBitmapToHandle;
    da_FreeImage_CloseMultiBitmap FreeImage_CloseMultiBitmap;
    da_FreeImage_GetPageCount FreeImage_GetPageCount;
    da_FreeImage_AppendPage FreeImage_AppendPage;
    da_FreeImage_InsertPage FreeImage_InsertPage;
    da_FreeImage_DeletePage FreeImage_DeletePage;
    da_FreeImage_LockPage FreeImage_LockPage;
    da_FreeImage_UnlockPage FreeImage_UnlockPage;
    da_FreeImage_MovePage FreeImage_MovePage;
    da_FreeImage_GetLockedPageNumbers FreeImage_GetLockedPageNumbers;
    da_FreeImage_GetFileType FreeImage_GetFileType;
    da_FreeImage_GetFileTypeU FreeImage_GetFileTypeU;
    da_FreeImage_GetFileTypeFromHandle FreeImage_GetFileTypeFromHandle;
    da_FreeImage_GetFileTypeFromMemory FreeImage_GetFileTypeFromMemory;
    da_FreeImage_GetImageType FreeImage_GetImageType;
    da_FreeImage_IsLittleEndian FreeImage_IsLittleEndian;
    da_FreeImage_LookupX11Color FreeImage_LookupX11Color;
    da_FreeImage_LookupSVGColor FreeImage_LookupSVGColor;
    da_FreeImage_GetBits FreeImage_GetBits;
    da_FreeImage_GetScanLine FreeImage_GetScanLine;
    da_FreeImage_GetPixelIndex FreeImage_GetPixelIndex;
    da_FreeImage_GetPixelColor FreeImage_GetPixelColor;
    da_FreeImage_SetPixelIndex FreeImage_SetPixelIndex;
    da_FreeImage_SetPixelColor FreeImage_SetPixelColor;
    da_FreeImage_GetColorsUsed FreeImage_GetColorsUsed;
    da_FreeImage_GetBPP FreeImage_GetBPP;
    da_FreeImage_GetWidth FreeImage_GetWidth;
    da_FreeImage_GetHeight FreeImage_GetHeight;
    da_FreeImage_GetLine FreeImage_GetLine;
    da_FreeImage_GetPitch FreeImage_GetPitch;
    da_FreeImage_GetDIBSize FreeImage_GetDIBSize;
    da_FreeImage_GetPalette FreeImage_GetPalette;
    da_FreeImage_GetDotsPerMeterX FreeImage_GetDotsPerMeterX;
    da_FreeImage_GetDotsPerMeterY FreeImage_GetDotsPerMeterY;
    da_FreeImage_SetDotsPerMeterX FreeImage_SetDotsPerMeterX;
    da_FreeImage_SetDotsPerMeterY FreeImage_SetDotsPerMeterY;
    da_FreeImage_GetInfoHeader FreeImage_GetInfoHeader;
    da_FreeImage_GetInfo FreeImage_GetInfo;
    da_FreeImage_GetColorType FreeImage_GetColorType;
    da_FreeImage_GetRedMask FreeImage_GetRedMask;
    da_FreeImage_GetGreenMask FreeImage_GetGreenMask;
    da_FreeImage_GetBlueMask FreeImage_GetBlueMask;
    da_FreeImage_GetTransparencyCount FreeImage_GetTransparencyCount;
    da_FreeImage_GetTransparencyTable FreeImage_GetTransparencyTable;
    da_FreeImage_SetTransparent FreeImage_SetTransparent;
    da_FreeImage_SetTransparencyTable FreeImage_SetTransparencyTable;
    da_FreeImage_IsTransparent FreeImage_IsTransparent;
    da_FreeImage_SetTransparentIndex FreeImage_SetTransparentIndex;
    da_FreeImage_GetTransparentIndex FreeImage_GetTransparentIndex;
    da_FreeImage_HasBackgroundColor FreeImage_HasBackgroundColor;
    da_FreeImage_GetBackgroundColor FreeImage_GetBackgroundColor;
    da_FreeImage_SetBackgroundColor FreeImage_SetBackgroundColor;
    da_FreeImage_GetThumbnail FreeImage_GetThumbnail;
    da_FreeImage_SetThumbnail FreeImage_SetThumbnail;
    da_FreeImage_GetICCProfile FreeImage_GetICCProfile;
    da_FreeImage_CreateICCProfile FreeImage_CreateICCProfile;
    da_FreeImage_DestroyICCProfile FreeImage_DestroyICCProfile;
    da_FreeImage_ConvertLine1To4 FreeImage_ConvertLine1To4;
    da_FreeImage_ConvertLine8To4 FreeImage_ConvertLine8To4;
    da_FreeImage_ConvertLine16To4_555 FreeImage_ConvertLine16To4_555;
    da_FreeImage_ConvertLine16To4_565 FreeImage_ConvertLine16To4_565;
    da_FreeImage_ConvertLine24To4 FreeImage_ConvertLine24To4;
    da_FreeImage_ConvertLine32To4 FreeImage_ConvertLine32To4;
    da_FreeImage_ConvertLine1To8 FreeImage_ConvertLine1To8;
    da_FreeImage_ConvertLine4To8 FreeImage_ConvertLine4To8;
    da_FreeImage_ConvertLine16To8_555 FreeImage_ConvertLine16To8_555;
    da_FreeImage_ConvertLine16To8_565 FreeImage_ConvertLine16To8_565;
    da_FreeImage_ConvertLine24To8 FreeImage_ConvertLine24To8;
    da_FreeImage_ConvertLine32To8 FreeImage_ConvertLine32To8;
    da_FreeImage_ConvertLine1To16_555 FreeImage_ConvertLine1To16_555;
    da_FreeImage_ConvertLine4To16_555 FreeImage_ConvertLine4To16_555;
    da_FreeImage_ConvertLine8To16_555 FreeImage_ConvertLine8To16_555;
    da_FreeImage_ConvertLine16_565_To16_555 FreeImage_ConvertLine16_565_To16_555;
    da_FreeImage_ConvertLine24To16_555 FreeImage_ConvertLine24To16_555;
    da_FreeImage_ConvertLine32To16_555 FreeImage_ConvertLine32To16_555;
    da_FreeImage_ConvertLine1To16_565 FreeImage_ConvertLine1To16_565;
    da_FreeImage_ConvertLine4To16_565 FreeImage_ConvertLine4To16_565;
    da_FreeImage_ConvertLine8To16_565 FreeImage_ConvertLine8To16_565;
    da_FreeImage_ConvertLine16_555_To16_565 FreeImage_ConvertLine16_555_To16_565;
    da_FreeImage_ConvertLine24To16_565 FreeImage_ConvertLine24To16_565;
    da_FreeImage_ConvertLine32To16_565 FreeImage_ConvertLine32To16_565;
    da_FreeImage_ConvertLine1To24 FreeImage_ConvertLine1To24;
    da_FreeImage_ConvertLine4To24 FreeImage_ConvertLine4To24;
    da_FreeImage_ConvertLine8To24 FreeImage_ConvertLine8To24;
    da_FreeImage_ConvertLine16To24_555 FreeImage_ConvertLine16To24_555;
    da_FreeImage_ConvertLine16To24_565 FreeImage_ConvertLine16To24_565;
    da_FreeImage_ConvertLine32To24 FreeImage_ConvertLine32To24;
    da_FreeImage_ConvertLine1To32 FreeImage_ConvertLine1To32;
    da_FreeImage_ConvertLine4To32 FreeImage_ConvertLine4To32;
    da_FreeImage_ConvertLine8To32 FreeImage_ConvertLine8To32;
    da_FreeImage_ConvertLine16To32_555 FreeImage_ConvertLine16To32_555;
    da_FreeImage_ConvertLine16To32_565 FreeImage_ConvertLine16To32_565;
    da_FreeImage_ConvertLine24To32 FreeImage_ConvertLine24To32;
    da_FreeImage_ConvertTo4Bits FreeImage_ConvertTo4Bits;
    da_FreeImage_ConvertTo8Bits FreeImage_ConvertTo8Bits;
    da_FreeImage_ConvertToGreyscale FreeImage_ConvertToGreyscale;
    da_FreeImage_ConvertTo16Bits555 FreeImage_ConvertTo16Bits555;
    da_FreeImage_ConvertTo16Bits565 FreeImage_ConvertTo16Bits565;
    da_FreeImage_ConvertTo24Bits FreeImage_ConvertTo24Bits;
    da_FreeImage_ConvertTo32Bits FreeImage_ConvertTo32Bits;
    da_FreeImage_ColorQuantize FreeImage_ColorQuantize;
    da_FreeImage_ColorQuantizeEx FreeImage_ColorQuantizeEx;
    da_FreeImage_Threshold FreeImage_Threshold;
    da_FreeImage_Dither FreeImage_Dither;
    da_FreeImage_ConvertFromRawBits FreeImage_ConvertFromRawBits;
    da_FreeImage_ConvertToRawBits FreeImage_ConvertToRawBits;
    da_FreeImage_ConvertToFloat FreeImage_ConvertToFloat;
    da_FreeImage_ConvertToRGBF FreeImage_ConvertToRGBF;
    da_FreeImage_ConvertToUINT16 FreeImage_ConvertToUINT16;
    da_FreeImage_ConvertToRGB16 FreeImage_ConvertToRGB16;
    da_FreeImage_ConvertToStandardType FreeImage_ConvertToStandardType;
    da_FreeImage_ConvertToType FreeImage_ConvertToType;
    da_FreeImage_ToneMapping FreeImage_ToneMapping;
    da_FreeImage_TmoDrago03 FreeImage_TmoDrago03;
    da_FreeImage_TmoReinhard05 FreeImage_TmoReinhard05;
    da_FreeImage_TmoReinhard05Ex FreeImage_TmoReinhard05Ex;
    da_FreeImage_TmoFattal02 FreeImage_TmoFattal02;
    da_FreeImage_ZLibCompress FreeImage_ZLibCompress;
    da_FreeImage_ZLibUncompress FreeImage_ZLibUncompress;
    da_FreeImage_ZLibGZip FreeImage_ZLibGZip;
    da_FreeImage_ZLibGUnzip FreeImage_ZLibGUnzip;
    da_FreeImage_ZLibCRC32 FreeImage_ZLibCRC32;

    // Commented out because of weird "Error: forward reference of FITAG"

    da_FreeImage_CreateTag FreeImage_CreateTag;
    da_FreeImage_DeleteTag FreeImage_DeleteTag;
    da_FreeImage_CloneTag FreeImage_CloneTag;
    da_FreeImage_GetTagKey FreeImage_GetTagKey;
    da_FreeImage_GetTagDescription FreeImage_GetTagDescription;
    da_FreeImage_GetTagID FreeImage_GetTagID;
    da_FreeImage_GetTagType FreeImage_GetTagType;
    da_FreeImage_GetTagCount FreeImage_GetTagCount;
    da_FreeImage_GetTagLength FreeImage_GetTagLength;
    da_FreeImage_GetTagValue FreeImage_GetTagValue;
    da_FreeImage_SetTagKey FreeImage_SetTagKey;
    da_FreeImage_SetTagDescription FreeImage_SetTagDescription;
    da_FreeImage_SetTagID FreeImage_SetTagID;
    da_FreeImage_SetTagType FreeImage_SetTagType;
    da_FreeImage_SetTagCount FreeImage_SetTagCount;
    da_FreeImage_SetTagLength FreeImage_SetTagLength;
    da_FreeImage_SetTagValue FreeImage_SetTagValue;
    da_FreeImage_FindFirstMetadata FreeImage_FindFirstMetadata;
    da_FreeImage_FindNextMetadata FreeImage_FindNextMetadata;
    da_FreeImage_FindCloseMetadata FreeImage_FindCloseMetadata;
    da_FreeImage_GetMetadata FreeImage_GetMetadata;
    da_FreeImage_SetMetadata FreeImage_SetMetadata;
    da_FreeImage_GetMetadataCount FreeImage_GetMetadataCount;
    da_FreeImage_CloneMetadata FreeImage_CloneMetadata;
    da_FreeImage_TagToString FreeImage_TagToString;


    da_FreeImage_RotateClassic FreeImage_RotateClassic;
    da_FreeImage_Rotate FreeImage_Rotate;
    da_FreeImage_RotateEx FreeImage_RotateEx;
    da_FreeImage_FlipHorizontal FreeImage_FlipHorizontal;
    da_FreeImage_FlipVertical FreeImage_FlipVertical;
    da_FreeImage_JPEGTransform FreeImage_JPEGTransform;
    da_FreeImage_JPEGTransformU FreeImage_JPEGTransformU;
    da_FreeImage_Rescale FreeImage_Rescale;
    da_FreeImage_MakeThumbnail FreeImage_MakeThumbnail;
    da_FreeImage_AdjustCurve FreeImage_AdjustCurve;
    da_FreeImage_AdjustGamma FreeImage_AdjustGamma;
    da_FreeImage_AdjustBrightness FreeImage_AdjustBrightness;
    da_FreeImage_AdjustContrast FreeImage_AdjustContrast;
    da_FreeImage_Invert FreeImage_Invert;
    da_FreeImage_GetHistogram FreeImage_GetHistogram;
    da_FreeImage_GetAdjustColorsLookupTable FreeImage_GetAdjustColorsLookupTable;
    da_FreeImage_AdjustColors FreeImage_AdjustColors;
    da_FreeImage_ApplyColorMapping FreeImage_ApplyColorMapping;
    da_FreeImage_SwapColors FreeImage_SwapColors;
    da_FreeImage_ApplyPaletteIndexMapping FreeImage_ApplyPaletteIndexMapping;
    da_FreeImage_SwapPaletteIndices FreeImage_SwapPaletteIndices;
    da_FreeImage_GetChannel FreeImage_GetChannel;
    da_FreeImage_SetChannel FreeImage_SetChannel;
    da_FreeImage_GetComplexChannel FreeImage_GetComplexChannel;
    da_FreeImage_SetComplexChannel FreeImage_SetComplexChannel;
    da_FreeImage_Copy FreeImage_Copy;
    da_FreeImage_Paste FreeImage_Paste;
    da_FreeImage_Composite FreeImage_Composite;
    da_FreeImage_JPEGCrop FreeImage_JPEGCrop;
    da_FreeImage_JPEGCropU FreeImage_JPEGCropU;
    da_FreeImage_PreMultiplyWithAlpha FreeImage_PreMultiplyWithAlpha;
    da_FreeImage_FillBackground FreeImage_FillBackground;
    da_FreeImage_EnlargeCanvas FreeImage_EnlargeCanvas;
    da_FreeImage_AllocateEx FreeImage_AllocateEx;
    da_FreeImage_AllocateExT FreeImage_AllocateExT;
    da_FreeImage_MultigridPoissonSolver FreeImage_MultigridPoissonSolver;
}
